﻿using System;
using Blader.UI.Forms;
using Blader.UI.Win32;

namespace Blader.ActionHandler
{
    public class SqlOpenHandler : IActionHandler
    {
        public bool Execute(HandlerContext handlerContext)
        {
            SearchForm searchForm = new SearchForm(handlerContext);
            IntPtr vsWindow = Native.FindWindow(null, "Microsoft SQL Server Management Studio");
            Native.SetWindowLong(searchForm.Handle, WindowLongFlags.GWLP_HWNDPARENT, vsWindow);
            searchForm.Show();
            return true;
        }
    }
}
